package com.jinghua.treatment.controller;

import com.jinghua.treatment.entity.SysShit;
import com.jinghua.treatment.service.SysShitService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 便情况控制器
 * Created by 王兴光 on 2018/3/26.
 */
@Controller
@RequestMapping("/shit")
public class SysShitController {

    @Resource
    private SysShitService shitService;

    @ApiOperation(value="根据便情况编号查询便情况信息")
    @GetMapping(value="/getShitById",params = {"shitId"})
    @ResponseBody
    public SysShit findShitById(Integer shitId){return shitService.selectByPrimaryKey(shitId);};

    @ApiOperation(value="新增便情况信息")
    @GetMapping(value="/insertShit")
    @ResponseBody
    public int insertShit(SysShit shit){return shitService.insert(shit);};

    @ApiOperation(value="更新便情况信息")
    @GetMapping(value="/updateShit")
    @ResponseBody
    public int updateShit(SysShit shit){return shitService.updateByPrimaryKey(shit);};
}
